***load data

use "${path}\data\gss\gss_ready.dta", clear 

***Main Tables

cd "${path}\output\tables\"

***Table I 
*Panel B (Run NAEP Analysis before for Panel A, and ACS Analysis afterwards for Panel C)
eststo: reg evo_approval evo_score if sample_gss==1, vce(cluster state16)
estadd ysumm
eststo: reg evo_approval evo_score $controls if sample_gss==1, vce(cluster state16)
estadd ysumm
eststo: reg evo_approval evo_score i.state16 i.cohort if sample_gss==1, vce(cluster state16)
estadd ysumm
eststo: reg evo_approval evo_score $controls i.state16 i.cohort, vce(cluster state16)
estadd ysumm
esttab using main_table_all.tex, append keep(evo_score) b(3) se(3) fragment  nomtitles nonumbers nonotes  label ///
stats(ymean ysd  r2_a N, labels ("Mean of Dep. Var." "Std. Dev. of Dep. Var." "Adj. R-squared" "Observations") fmt(2 2 3 %9.0fc))  /// 
star(* 0.1 ** 0.05 *** 0.01)  ///
refcat(evo_score "\specialcellleft{\textbf{\emph{Panel B: Outcome: Evolution Belief in Adulthood}}}", nolabel)
eststo clear

***Table II 
*Panel B (Run NAEP Analysis before for Panel A, and ACS Analysis afterwards for Panel C)

eststo: reg evo_approval evo_score $controls i.state16 i.cohort if closestate10==1, vce(cluster state16)
estadd ysumm
eststo: reg evo_approval evo_score $controls democrat i.state16 i.cohort, vce(cluster state16)
estadd ysumm
eststo: reg evo_approval evo_score $controls $statespecifictrends $statespecifictrends_q i.state16 i.cohort, vce(cluster state16)
estadd ysumm
rename evo_score evo_score_temp
rename evo_score_dosage evo_score
eststo: reg evo_approval evo_score $controls i.state16 i.cohort, vce(cluster state16)
estadd ysumm
rename evo_score evo_score_dosage
rename evo_score_temp evo_score
eststo: reg evo_approval evo_score $controls i.state16 i.cohort if onereform==1, vce(cluster state16)
estadd ysumm
eststo: reg evo_approval evo_score $controls i.state16 i.cohort if largestate==1, vce(cluster state16)
estadd ysumm
eststo: reg evo_approval evo_score $controls i.state16 i.cohort if textstate==1, vce(cluster state16)
estadd ysumm
eststo: reg evo_approval evo_score $controls i.state16 i.cohort if highschoolentryyear>1994, vce(cluster state16)
estadd ysumm
eststo: reg evo_approval evo_score $controls i.state16 i.cohort if highschoolentryyear>1999, vce(cluster state16)
estadd ysumm
probit evo_approval evo_score $controls i.state16 i.cohort, vce(cluster state16)
estadd ysumm
estadd scalar r2_a = round(e(r2_p), .001)
estpost margins, dydx(evo_score)
eststo ames2
eststo: reg evo_approval2 evo_score $controls i.state16 i.cohort , vce(cluster state16)
estadd ysumm
eststo: reg evo_approval3 evo_score $controls i.state16 i.cohort, vce(cluster state16)
estadd ysumm
esttab using further_robustness_all.tex, append keep(evo_score) fragment b(3) se(3) noobs nonumbers nomtitles nonotes label ///
star(* 0.1 ** 0.05 *** 0.01) ///
refcat(evo_score "\specialcellleft{\textbf{\emph{Panel B: Outcome: Evolution Belief in Adulthood}}}", nolabel)

eststo clear

***Online Appendix Tables

cd "${path}\output\tables"

***Table A.IV
*Panel B

centile (evo_score) if less_evolution==1, centile (20 80)

csdid evo_approval_conv if less_evolution==1 , time(highschoolentryyear) notyet gvar(first_treat) agg(event) method(dripw) rseed(2) cluster(state16)
estat simple

csdid evo_approval_conv if less_evolution==1 & evo_score<0.95 & evo_score>0.64, time(highschoolentryyear) notyet gvar(first_treat) agg(event) method(dripw) rseed(2) cluster(state16)
estat simple

centile (evo_score) if more_evolution==1, centile (20 80)

csdid evo_approval if more_evolution==1 , time(highschoolentryyear) notyet gvar(first_treat) agg(event) method(dripw) rseed(2) cluster(state16)
estat simple

csdid evo_approval if more_evolution==1 & evo_score<0.8 & evo_score>0.07, time(highschoolentryyear) notyet gvar(first_treat) agg(event) method(dripw) rseed(2) cluster(state16)
estat simple

***Table A.VII

foreach v of varlist evo_approval placebo_share_correct hotcore radioact boyorgrl lasers electron viruses bigbang condrift earthsun  {
eststo: reg `v' evo_score $controls i.state16 i.cohort, vce(cluster state16)
estadd ysumm
}
esttab using gss_placebo_scientific_knowledge.tex, replace keep(evo_score) fragment  b(3) se(3) nomtitles nonotes label ///
stats(ymean ysd r2_a N, labels ("Mean of Dep. Var." "Std. Dev. of Dep. Var." "Adj. R-squared" "Observations") fmt(2 2 3 %9.0fc)) ///
mgroups("Main Outcome:" "Non-Evolution Scientific Topics:", pattern(1 1 0 0 0 0 0 0 0 0 0) prefix(\multicolumn{@span} {c} {) suffix (}) span erepeat(\cmidrule(lr) {@span})) ///
mlabels("Evolution" "Average" "Earth" "Radioactivity" "Reproduction" "Lasers" "Electrons" "Antibiotics" "Universe" "Tectonics" "Sun" ) ///
star(* 0.1 ** 0.05 *** 0.01)  
eststo clear

***test for statistical significance

foreach v of varlist evo_approval hotcore radioact boyorgrl lasers electron viruses bigbang condrift earthsun placebo_share_correct {
eststo: reg `v' evo_score $controls i.state16 i.cohort
estadd ysumm
estimates store `v'
}

suest evo_approval hotcore, vce(cluster state) coeflegend
test _b[evo_approval_mean:evo_score] = _b[hotcore_mean:evo_score]

suest evo_approval radioact, vce(cluster state) coeflegend
test _b[evo_approval_mean:evo_score] = _b[radioact_mean:evo_score]

suest evo_approval boyorgrl, vce(cluster state) coeflegend
test _b[evo_approval_mean:evo_score] = _b[boyorgrl_mean:evo_score]

suest evo_approval lasers, vce(cluster state) coeflegend
test _b[evo_approval_mean:evo_score] = _b[lasers_mean:evo_score]

suest evo_approval electron, vce(cluster state) coeflegend
test _b[evo_approval_mean:evo_score] = _b[electron_mean:evo_score]

suest evo_approval viruses, vce(cluster state) coeflegend
test _b[evo_approval_mean:evo_score] = _b[viruses_mean:evo_score]

suest evo_approval bigbang, vce(cluster state) coeflegend
test _b[evo_approval_mean:evo_score] = _b[bigbang_mean:evo_score]

suest evo_approval condrift, vce(cluster state) coeflegend
test _b[evo_approval_mean:evo_score] = _b[condrift_mean:evo_score]

suest evo_approval earthsun, vce(cluster state) coeflegend
test _b[evo_approval_mean:evo_score] = _b[earthsun_mean:evo_score]

suest evo_approval placebo_share_correct, vce(cluster state) coeflegend
test _b[evo_approval_mean:evo_score] = _b[placebo_share_correct_mean:evo_score]

eststo clear

***Table A.VIII

foreach v of varlist evo_approval placebo_share_correct_sciatt advfront consci  intsci   {
eststo: reg `v' evo_score $controls i.state16 i.cohort, vce(cluster state16)
estadd ysumm
}
esttab using gss_placebo_scientific_attitudes.tex, replace keep(evo_score) fragment  b(3) se(3) nomtitles nonotes label ///
stats(ymean ysd r2_a N, labels ("Mean of Dep. Var." "Std. Dev. of Dep. Var." "Adj. R-squared" "Observations") fmt(2 2 3 %9.0fc)) ///
mgroups("Main Outcome:" "Non-Evolution Science Attitudes:", pattern(1 1 0 0) prefix(\multicolumn{@span} {c} {) suffix (}) span erepeat(\cmidrule(lr) {@span})) ///
mlabels("Evolution" "Average" "\specialcell{Scientific Research \\ is Necessary}" "\specialcell{Confidence \\ in Science}"  "\specialcell{Interest \\ in Science}"  ) ///
star(* 0.1 ** 0.05 *** 0.01)  
eststo clear

***test for statistical significance

fvset base 2012 surveyyear

gen shr_att = placebo_share_correct_sciatt
foreach v of varlist evo_approval shr_att advfront consci  intsci   {
eststo: reg `v' evo_score $controls i.state16 i.cohort
estadd ysumm
estimates store `v'
}

suest evo_approval shr_att, vce(cluster state16) coeflegend
test _b[evo_approval_mean:evo_score] = _b[shr_att_mean:evo_score]

suest evo_approval advfront, vce(cluster state16) coeflegend
test _b[evo_approval_mean:evo_score] = _b[advfront_mean:evo_score]

suest evo_approval consci, vce(cluster state16) coeflegend
test _b[evo_approval_mean:evo_score] = _b[consci_mean:evo_score]

suest evo_approval intsci, vce(cluster state16) coeflegend
test _b[evo_approval_mean:evo_score] = _b[intsci_mean:evo_score]

eststo clear

***Table A.IX
*Panel A

foreach v of varlist  evo_approval placebo_religiosity_average god bible postlife reborn reliten  {
eststo: reg `v' evo_score $controls i.state16 i.cohort, vce(cluster state16)
estadd ysumm
}
esttab using gss_placebo_religious_outcomes_app.tex, replace keep(evo_score) fragment b(3) se(3) nomtitles nonotes label ///
stats(ymean ysd r2_a N k, labels ("Mean of Dep. Var." "Std. Dev. of Dep. Var." "Adj. R-squared" "Observations" \hline) fmt(2 2 3 %9.0fc)) ///
mlabels("Evolution" "Average" "God" "Bible" "Afterlife" "Rebirth" "\specialcell{Strong \\ Believer}" ) ///
mgroups("Main Outcome:" "\specialcell{Religious \\ Outcomes: \\Average}" "\specialcell{Religious \\ Outcomes: \\ Believing}"  , pattern(1 1 1 0 0 0 0)  prefix(\multicolumn{@span} {c} {) suffix (}) span erepeat(\cmidrule(lr) {@span})) ///
refcat(evo_score "\specialcellleft{\textbf{\emph{Panel A Outcomes: Main; Religious Average; Religious Believing}}}", nolabel) ///
star(* 0.1 ** 0.05 *** 0.01)  
eststo clear

***Table A.IX
*Panel B

foreach v of varlist  relig attend relactiv pray savesoul sprtprsn relpersn fund   {
eststo: reg `v' evo_score $controls i.state16 i.cohort, vce(cluster state16)
estadd ysumm
}
esttab using gss_placebo_religious_outcomes_app.tex, append keep(evo_score) fragment b(3) se(3) nomtitles nonotes label ///
stats(ymean ysd r2_a N, labels ("Mean of Dep. Var." "Std. Dev. of Dep. Var." "Adj. R-squared" "Observations") fmt(2 2 3 %9.0fc)) ///
mlabels("\specialcell{Religious \\ Affiliation}" "\specialcell{Church- \\ going}" "\specialcell{Church \\ Activities}" "\specialcell{Personal \\ Prayer}" "Missionize" "\specialcell{Spiritual \\ Person}" "\specialcell{Religious \\ Person}" "Fundamentalist") ///
mgroups("\specialcell{Religious \\ Outcomes: \\ Belonging and Activities}" "\specialcell{Religious \\ Outcomes: \\ Overall}" , pattern(1 0 0 0 0 1 0 0)  prefix(\multicolumn{@span} {c} {) suffix (}) span erepeat(\cmidrule(lr) {@span})) ///
refcat(evo_score "\specialcellleft{\textbf{\emph{Panel B Outcomes: Religious Belonging; Religious Overall}}}", nolabel) ///
star(* 0.1 ** 0.05 *** 0.01)  
eststo clear

egen placebo_religiosity_beliefs=rowmean(god bible postlife reborn reliten)
label variable placebo_religiosity_beliefs "Religious Beliefs: Average"
reg placebo_religiosity_beliefs evo_score $controls i.state16 i.cohort, vce(cluster state16)
eststo clear

***test for statistical significance

foreach v of varlist evo_approval god bible postlife reborn reliten relig attend relactiv pray savesoul sprtprsn relpersn fund placebo_religiosity_average placebo_religiosity_beliefs {
eststo: reg `v' evo_score $controls i.state16 i.cohort
estadd ysumm
estimates store `v'
}

suest evo_approval god, vce(cluster state16) coeflegend
test _b[evo_approval_mean:evo_score] = _b[god_mean:evo_score]

suest evo_approval bible, vce(cluster state16) coeflegend
test _b[evo_approval_mean:evo_score] = _b[bible_mean:evo_score]

suest evo_approval postlife, vce(cluster state16) coeflegend
test _b[evo_approval_mean:evo_score] = _b[postlife_mean:evo_score]

suest evo_approval reborn, vce(cluster state16) coeflegend
test _b[evo_approval_mean:evo_score] = _b[reborn_mean:evo_score]

suest evo_approval reliten, vce(cluster state16) coeflegend
test _b[evo_approval_mean:evo_score] = _b[reliten_mean:evo_score]

suest evo_approval relig, vce(cluster state16) coeflegend
test _b[evo_approval_mean:evo_score] = _b[relig_mean:evo_score]

suest evo_approval attend, vce(cluster state16) coeflegend
test _b[evo_approval_mean:evo_score] = _b[attend_mean:evo_score]

suest evo_approval relactiv, vce(cluster state16) coeflegend
test _b[evo_approval_mean:evo_score] = _b[relactiv_mean:evo_score]

suest evo_approval pray, vce(cluster state16) coeflegend
test _b[evo_approval_mean:evo_score] = _b[pray_mean:evo_score]

suest evo_approval savesoul, vce(cluster state16) coeflegend
test _b[evo_approval_mean:evo_score] = _b[savesoul_mean:evo_score]

suest evo_approval sprtprsn, vce(cluster state16) coeflegend
test _b[evo_approval_mean:evo_score] = _b[sprtprsn_mean:evo_score]

suest evo_approval relpersn, vce(cluster state16) coeflegend
test _b[evo_approval_mean:evo_score] = _b[relpersn_mean:evo_score]

suest evo_approval fund, vce(cluster state16) coeflegend
test _b[evo_approval_mean:evo_score] = _b[fund_mean:evo_score]

suest evo_approval placebo_religiosity_average, vce(cluster state16) coeflegend
test _b[evo_approval_mean:evo_score] = _b[placebo_religiosity_average_mean:evo_score]

suest evo_approval placebo_religiosity_beliefs, vce(cluster state16) coeflegend
test _b[evo_approval_mean:evo_score] = _b[placebo_religiosity_beliefs_mean:evo_score]

eststo clear

***Table A.X
*Panel A
foreach v of varlist  evo_approval placebo_political_average prayer_recode sexeduc_recode marhomo_recode abany_recode grass_recode cappun_recode gunlaw_recode letin1_recode {
eststo: reg `v' evo_score $controls i.state16 i.cohort, vce(cluster state16)
estadd ysumm
}
esttab using gss_placebo_political_outcomes_app.tex, replace keep(evo_score) fragment b(3) se(3) nomtitles nonotes label ///
stats(ymean ysd r2_a N k, labels ("Mean of Dep. Var." "Std. Dev. of Dep. Var." "Adj. R-squared" "Observations" \hline) fmt(2 2 3 %9.0fc)) ///
mlabels("Evolution" "Average" "\specialcell{Prayer \\ in \\ Public \\ Schools}" "\specialcell{Sex \\ Education \\ in Public \\ Schools}" "\specialcell{Same-Sex \\ Marriage}" "\specialcell{Abor- \\ tion}" "\specialcell{Marijuana \\ Legali- \\ zation}" "\specialcell{Capital \\ Punish- \\ ment}" "\specialcell{Gun \\ Control}" "\specialcell{Immi- \\ gration}" ) ///
mgroups("\specialcell{Main \\ Outcome:}"  "\specialcell{Political \\ Outcomes: \\ Average}"  "\specialcell{Political Outcomes: \\ Conservative attitude on:}", pattern(1 1 1 0 0 0 0 0 0 0)  prefix(\multicolumn{@span} {c} {) suffix (}) span erepeat(\cmidrule(lr) {@span})) ///
refcat(evo_score "\specialcellleft{\textbf{\emph{Panel A Outcomes: Main; Political Average; Political Attitudes}}}", nolabel) ///
star(* 0.1 ** 0.05 *** 0.01)  
eststo clear

*Panel B
foreach v of varlist natenvir_recode natenrgy_recode nateduc_recode natsci_recode eqwlth_recode natfare_recode natrace_recode partyid_recode polviews_recode {
eststo: reg `v' evo_score $controls i.state16 i.cohort, vce(cluster state16)
estadd ysumm
}
esttab using gss_placebo_political_outcomes_app.tex, append keep(evo_score) fragment b(3) se(3) nomtitles nonotes label ///
stats(ymean ysd r2_a N, labels ("Mean of Dep. Var." "Std. Dev. of Dep. Var." "Adj. R-squared" "Observations") fmt(2 2 3 %9.0fc)) ///
mlabels("\specialcell{Environ- \\ ment}" "\specialcell{Alternative \\ Energy \\ Sources}" "\specialcell{Educa- \\ tion}" "\specialcell{Scientific \\ Research}" "\specialcell{Reducing \\ Income \\ Differences}" "\specialcell{Assistance \\ to the \\ Poor}" "\specialcell{Conditions \\ of Blacks}" "\specialcell{Repub- \\ lican}" "\specialcell{Conser- \\ vative}") ///
mgroups("\specialcell{Political Outcomes: \\ Conservative attitude on governmental spending for:}" "\specialcell{Political Outcomes: \\ General}" , pattern(1 0 0 0 0 0 0 1 0)  prefix(\multicolumn{@span} {c} {) suffix (}) span erepeat(\cmidrule(lr) {@span})) ///
refcat(evo_score "\specialcellleft{\textbf{\emph{Panel B Outcomes: Political Spending; Political General}}}", nolabel) ///
star(* 0.1 ** 0.05 *** 0.01)  
eststo clear

***test for statistical significance

foreach v of varlist evo_approval partyid_recode polviews_recode prayer_recode sexeduc_recode marhomo_recode abany_recode grass_recode cappun_recode gunlaw_recode letin1_recode natenvir_recode natenrgy_recode nateduc_recode natsci_recode eqwlth_recode natfare_recode natrace_recode placebo_political_average {
eststo: reg `v' evo_score $controls i.state16 i.cohort
estadd ysumm
estimates store `v'
}

suest evo_approval partyid_recode, vce(cluster state16) coeflegend
test _b[evo_approval_mean:evo_score] = _b[partyid_recode_mean:evo_score]

suest evo_approval polviews_recode, vce(cluster state16) coeflegend
test _b[evo_approval_mean:evo_score] = _b[polviews_recode_mean:evo_score]

suest evo_approval prayer_recode, vce(cluster state16) coeflegend
test _b[evo_approval_mean:evo_score] = _b[prayer_recode_mean:evo_score]

suest evo_approval sexeduc_recode, vce(cluster state16) coeflegend
test _b[evo_approval_mean:evo_score] = _b[sexeduc_recode_mean:evo_score]

suest evo_approval marhomo_recode, vce(cluster state16) coeflegend
test _b[evo_approval_mean:evo_score] = _b[marhomo_recode_mean:evo_score]

suest evo_approval abany_recode, vce(cluster state16) coeflegend
test _b[evo_approval_mean:evo_score] = _b[abany_recode_mean:evo_score]

suest evo_approval grass_recode, vce(cluster state16) coeflegend
test _b[evo_approval_mean:evo_score] = _b[grass_recode_mean:evo_score]

suest evo_approval cappun_recode, vce(cluster state16) coeflegend
test _b[evo_approval_mean:evo_score] = _b[cappun_recode_mean:evo_score]

suest evo_approval gunlaw_recode, vce(cluster state16) coeflegend
test _b[evo_approval_mean:evo_score] = _b[gunlaw_recode_mean:evo_score]

suest evo_approval letin1_recode, vce(cluster state16) coeflegend
test _b[evo_approval_mean:evo_score] = _b[letin1_recode_mean:evo_score]

suest evo_approval natenvir_recode, vce(cluster state16) coeflegend
test _b[evo_approval_mean:evo_score] = _b[natenvir_recode_mean:evo_score]

suest evo_approval natenrgy_recode, vce(cluster state16) coeflegend
test _b[evo_approval_mean:evo_score] = _b[natenrgy_recode_mean:evo_score]

suest evo_approval nateduc_recode, vce(cluster state16) coeflegend
test _b[evo_approval_mean:evo_score] = _b[nateduc_recode_mean:evo_score]

suest evo_approval natsci_recode, vce(cluster state16) coeflegend
test _b[evo_approval_mean:evo_score] = _b[natsci_recode_mean:evo_score]

suest evo_approval eqwlth_recode, vce(cluster state16) coeflegend
test _b[evo_approval_mean:evo_score] = _b[eqwlth_recode_mean:evo_score]

suest evo_approval natfare_recode, vce(cluster state16) coeflegend
test _b[evo_approval_mean:evo_score] = _b[natfare_recode_mean:evo_score]

suest evo_approval natrace_recode, vce(cluster state16) coeflegend
test _b[evo_approval_mean:evo_score] = _b[natrace_recode_mean:evo_score]

suest evo_approval placebo_political_average, vce(cluster state16) coeflegend
test _b[evo_approval_mean:evo_score] = _b[placebo_political_average_mean:evo_score]

eststo clear

***Table A.XIII

eststo: reg evo_approval evo_score $controls i.state16 i.cohort if closestate10==1, vce(cluster state16)
estadd ysumm
eststo: reg evo_approval evo_score $controls democrat i.state16 i.cohort, vce(cluster state16)
estadd ysumm
eststo: reg evo_approval evo_score $controls $statespecifictrends $statespecifictrends_q i.state16 i.cohort, vce(cluster state16)
estadd ysumm
rename evo_score evo_score_temp
rename evo_score_dosage evo_score
eststo: reg evo_approval evo_score $controls i.state16 i.cohort, vce(cluster state16)
estadd ysumm
rename evo_score evo_score_dosage
rename evo_score_temp evo_score
eststo: reg evo_approval evo_score $controls i.state16 i.cohort if onereform==1, vce(cluster state16)
estadd ysumm
eststo: reg evo_approval evo_score $controls i.state16 i.cohort if largestate==1, vce(cluster state16)
estadd ysumm
eststo: reg evo_approval evo_score $controls i.state16 i.cohort if textstate==1, vce(cluster state16)
estadd ysumm
eststo: reg evo_approval evo_score $controls i.state16 i.cohort if highschoolentryyear>1994, vce(cluster state16)
estadd ysumm
eststo: reg evo_approval evo_score $controls i.state16 i.cohort if highschoolentryyear>1999, vce(cluster state16)
estadd ysumm
probit evo_approval evo_score $controls i.state16 i.cohort, vce(cluster state16)
estadd ysumm
estadd scalar r2_a = round(e(r2_p), .001)
estpost margins, dydx(evo_score)
eststo ames2
eststo: reg evo_approval2 evo_score $controls i.state16 i.cohort, vce(cluster state16)
estadd ysumm
eststo: reg evo_approval3 evo_score $controls i.state16 i.cohort , vce(cluster state16)
estadd ysumm
esttab using gss_further_robustness.tex, replace keep(evo_score) fragment b(3) se(3) nomtitles nonotes label ///
stats(ymean ysd r2_a N, labels ("Mean of Dep. Var." "Std. Dev. of Dep. Var." "Adj. R-squared" "Observations") fmt(2 2 3 %9.0fc)) ///
mlabels("\specialcell{Close \\ Elections}" "\specialcell{Control: \\ Governor's \\ Party}" "\specialcell{State Specific \\ Time Trends}" "\specialcell{Dosage \\ Treatment}" "\specialcell{Only One \\ Reform Event}" "\specialcell{Only Large \\ States}" "\specialcell{Only States \\ With Std. Text}" "\specialcell{Sample Start: \\ 1995}" "\specialcell{Sample Start: \\ 2000}" "Probit" "\specialcell{Outcome Coding \\ Variation 1}" "\specialcell{Outcome Coding \\ Variation 2}" ) ///
indicate("State FEs = *state16" "Cohort FE = *cohort" "Controls = race_other", labels("YES" "YES")) ///
star(* 0.1 ** 0.05 *** 0.01)
eststo clear

***test for statistical significance

fvset base 5 state16
fvset base 1990 cohort

reg evo_approval evo_score $controls i.state16 i.cohort
estimates store base

reg evo_approval evo_score $controls i.state16 i.cohort if closestate10==1
estimates store close

reg evo_approval evo_score $controls democrat i.state16 i.cohort
estimates store demo

reg evo_approval evo_score $controls $statespecifictrends $statespecifictrends_q i.state16 i.cohort
estimates store trends

rename evo_score evo_score_temp
rename evo_score_dosage evo_score
reg evo_approval evo_score $controls i.state16 i.cohort
estimates store dosage
estadd ysumm
rename evo_score evo_score_dosage
rename evo_score_temp evo_score

reg evo_approval evo_score $controls i.state16 i.cohort if onereform==1
estimates store oneref

reg evo_approval evo_score $controls i.state16 i.cohort if largestate==1
estimates store largestate

reg evo_approval evo_score $controls i.state16 i.cohort if textstate==1
estimates store textstate

reg evo_approval evo_score $controls i.state16 i.cohort if highschoolentryyear>1994
estimates store samp1

reg evo_approval evo_score $controls i.state16 i.cohort if  highschoolentryyear>1999
estimates store samp2

reg evo_approval2 evo_score $controls i.state16 i.cohort 
estimates store outc1
 
reg evo_approval3 evo_score $controls i.state16 i.cohort 
estimates store outc2

suest base close, vce(cluster state16) coeflegend
test _b[base_mean:evo_score] = _b[close_mean:evo_score]

suest base demo, vce(cluster state16) coeflegend
test _b[base_mean:evo_score] = _b[demo_mean:evo_score]

suest base trends, vce(cluster state16) coeflegend
test _b[base_mean:evo_score] = _b[trends_mean:evo_score]

suest base dosage, vce(cluster state16) coeflegend
test _b[base_mean:evo_score] = _b[dosage_mean:evo_score]

suest base oneref, vce(cluster state16) coeflegend
test _b[base_mean:evo_score] = _b[oneref_mean:evo_score]

suest base largestate, vce(cluster state16) coeflegend
test _b[base_mean:evo_score] = _b[largestate_mean:evo_score]

suest base textstate, vce(cluster state16) coeflegend
test _b[base_mean:evo_score] = _b[textstate_mean:evo_score]

suest base samp1, vce(cluster state16) coeflegend
test _b[base_mean:evo_score] = _b[samp1_mean:evo_score]

suest base samp2, vce(cluster state16) coeflegend
test _b[base_mean:evo_score] = _b[samp2_mean:evo_score]

suest base outc1, vce(cluster state16) coeflegend
test _b[base_mean:evo_score] = _b[outc1_mean:evo_score]

suest base outc2, vce(cluster state16) coeflegend
test _b[base_mean:evo_score] = _b[outc2_mean:evo_score]

quietly generate yreg = evo_approval
quietly generate yprobit = evo_approval
gsem (yprobit  <- evo_score $controls i.state16 i.cohort, probit  vce(cluster state16)) (yreg <- evo_score $controls i.state16 i.cohort)
margins, dydx(evo_score) post
margins, coeflegend
test  _b[evo_score:1bn._predict]= _b[evo_score:2._predict]

***Table A.XXI

preserve 
eststo: estpost corr evo_approval placebo_share_correct hotcore radioact boyorgrl lasers electron viruses bigbang condrift earthsun  if evo_approval!=.
esttab using gss_scientific_areas_correlation_short.tex, nonumber not unstack compress noobs replace fragment nonotes label star(* 0.1 ** 0.05 *** 0.01)
eststo clear
restore

***Table A.XXII

preserve 
eststo: estpost corr evo_approval placebo_share_correct_sciatt advfront consci  intsci  if evo_approval!=.
esttab using gss_scientific_att_correlation_short.tex, nonumber not unstack compress noobs replace fragment nonotes label star(* 0.1 ** 0.05 *** 0.01)
eststo clear
restore

***Table A.XXIII

preserve 
eststo: estpost corr evo_approval placebo_religiosity_average god bible postlife reborn reliten relig attend relactiv pray savesoul sprtprsn relpersn fund  if evo_approval!=.
esttab using gss_religious_outcomes_correlation_short.tex, nonumber not unstack compress noobs replace fragment nonotes label star(* 0.1 ** 0.05 *** 0.01)
eststo clear
restore

***Table A.XXIV 

preserve 
eststo: estpost corr  evo_approval placebo_political_average prayer_recode sexeduc_recode marhomo_recode abany_recode grass_recode cappun_recode gunlaw_recode letin1_recode natenvir_recode natenrgy_recode nateduc_recode natsci_recode eqwlth_recode natfare_recode natrace_recode partyid_recode polviews_recode if evo_approval!=.
esttab using gss_political_outcomes_correlation_short.tex, nonumber not unstack compress noobs replace fragment nonotes label star(* 0.1 ** 0.05 *** 0.01)  
eststo clear
restore

***Table A.XXV

preserve
foreach v of varlist * {
label variable `v' `"\hspace{0.1cm} `: variable label `v''"'
}
eststo: estpost sum evo_score evo_approval placebo_share_correct hotcore radioact boyorgrl lasers electron viruses bigbang condrift earthsun placebo_share_correct_sciatt advfront consci  intsci  placebo_religiosity_average god bible postlife reborn reliten relig attend relactiv pray savesoul sprtprsn relpersn fund placebo_political_average prayer_recode sexeduc_recode marhomo_recode abany_recode grass_recode cappun_recode gunlaw_recode letin1_recode natenvir_recode
esttab using gss_long_descriptive_statistics_1.tex, replace wide cells("mean(fmt(%9.2fc) label(Mean)) sd(fmt(%9.2fc) label(\specialcell{Std. \\ Dev.})) min(fmt(%9.2fc) label(Min.)) max(fmt(%9.2fc) label(Max.))") label booktabs nonum fragment noobs ///
refcat(evo_score "\emph{Treatment Variable:}" evo_approval "\emph{Main Outcome:}" placebo_share_correct "\emph{Non-Evolution Scientific Topics:}" placebo_share_correct_sciatt "\emph{Non-Evolution Science Attitudes:}" placebo_religiosity_average "\emph{Religious Attitudes:}" placebo_political_average "\emph{Political Attitudes:}", nolabel)
eststo clear
restore

preserve
foreach v of varlist * {
label variable `v' `"\hspace{0.1cm} `: variable label `v''"'
}
eststo: estpost sum natenrgy_recode nateduc_recode natsci_recode eqwlth_recode natfare_recode natrace_recode partyid_recode polviews_recode  female race_white race_black race_other hispanic rural parborn_us_ni parborn_abroad_ni pareduc_nohs_ni pareduc_hs_ni pareduc_hsmore_ni family16_both family16_parstep family16_single family16_other mainline prot_evangelical relig16dummy2 relig16dummy3 relig16dummy4 relig16dummy5 relig16dummy6 relig16dummy7 relig16dummy8 relig16dummy9 relig16dummy10 relig16dummy11 relig16dummy12 relig16dummy13
esttab using gss_long_descriptive_statistics_2.tex, replace wide cells("mean(fmt(%9.2fc) label(Mean)) sd(fmt(%9.2fc) label(\specialcell{Std. \\ Dev.})) min(fmt(%9.2fc) label(Min.)) max(fmt(%9.2fc) label(Max.))") label booktabs nonum fragment noobs ///
refcat(natenrgy_recode "\emph{Political Attitudes (continued):}" female "\emph{Controls:}", nolabel)
eststo clear
restore

***Table A.XXIX

eststo: estpost summarize family16_singlep family16_parstep family16_both family16_other parborn_us parborn_abroad race_black race_white race_other hispanic rural  mainline prot_evangelicals relig16dummy2 relig16dummy4 if race_black==1
eststo: estpost summarize family16_singlep family16_parstep family16_both family16_other parborn_us parborn_abroad race_black race_white race_other hispanic rural  mainline prot_evangelicals relig16dummy2 relig16dummy4  if race_white==1
eststo: estpost summarize family16_singlep family16_parstep family16_both family16_other parborn_us parborn_abroad race_black race_white race_other hispanic rural  mainline prot_evangelicals relig16dummy2 relig16dummy4 if rural==1
eststo: estpost summarize family16_singlep family16_parstep family16_both family16_other parborn_us parborn_abroad race_black race_white race_other hispanic rural  mainline prot_evangelicals relig16dummy2 relig16dummy4 if rural==0
eststo: estpost summarize family16_singlep family16_parstep family16_both family16_other parborn_us parborn_abroad race_black race_white race_other hispanic rural  mainline prot_evangelicals relig16dummy2 relig16dummy4 if mainline==1
eststo: estpost summarize  family16_singlep family16_parstep family16_both family16_other parborn_us parborn_abroad race_black race_white race_other hispanic rural  mainline prot_evangelicals relig16dummy2 relig16dummy4  if prot_evangelicals==1
eststo: estpost summarize  family16_singlep family16_parstep family16_both family16_other parborn_us parborn_abroad race_black race_white race_other hispanic rural  mainline prot_evangelicals relig16dummy2 relig16dummy4  if relig16dummy2==1
eststo: estpost summarize  family16_singlep family16_parstep family16_both family16_other parborn_us parborn_abroad race_black race_white race_other hispanic rural  mainline prot_evangelicals relig16dummy2 relig16dummy4  if relig16dummy4==1
esttab using weighted_all.tex, replace wide  label booktabs nonum fragment noobs ///
cells("mean(fmt(%9.2fc) label(Mean)) ") ///
mgroups("Black" "White" "Rural" "Urban" "\specialcell{Mainline \\ Protestant}" "Evangelical" "Catholic" "Non-Religious", pattern(1 1 1 1 1 1 1 1) prefix(\multicolumn{@span} {c} {) suffix (}) span erepeat(\cmidrule(lr) {@span})) 
eststo clear

***Table A.XXXIII

foreach i of num 9/1 {
eststo: reg evo_approval evo_score_`i' $controls i.state16 i.cohort, vce(cluster state16)
estadd ysumm
}
esttab using gss_heterogeneity_level.tex, replace keep(evo_score_9 evo_score_8 evo_score_7 evo_score_6 evo_score_5 evo_score_4 evo_score_3 evo_score_2 evo_score_1) fragment b(3) se(3) nomtitles nonotes label ///
stats(ymean ysd r2_a N, labels ("Mean of Dep. Var." "Std. Dev. of Dep. Var." "Adj. R-squared" "Observations") fmt(2 2 3 %9.0fc)) ///
mgroups("Evolution Belief", pattern(1 0 0 0 0 0 0 0 0) prefix(\multicolumn{@span} {c} {) suffix (}) span erepeat(\cmidrule(lr) {@span})) ///
indicate("State FEs = *state16" "Cohort FE = *cohort" "Controls = race_other", labels("YES" "NO")) ///
star(* 0.1 ** 0.05 *** 0.01)
eststo clear

***load data

use "${path}\data\gss\gss_ready_table_a-xv.dta", clear 

***Online Appendix Tables

cd "${path}\output\tables"

***Table A.XV

preserve
foreach v of varlist * {
label variable `v' `"\hspace{0.1cm} `: variable label `v''"'
}
eststo: estpost sum evo_approval hotcore radioact boyorgrl lasers electron viruses bigbang condrift earthsun placebo_share_correct god bible postlife reborn reliten relig attend relactiv pray savesoul sprtprsn relpersn fund placebo_religiosity_average partyid_recode polviews_recode prayer_recode sexeduc_recode marhomo_recode abany_recode grass_recode cappun_recode gunlaw_recode letin1_recode natenvir_recode natenrgy_recode nateduc_recode natsci_recode eqwlth_recode natfare_recode natrace_recode placebo_political_average if sample_textstate==1
eststo: estpost sum evo_approval hotcore radioact boyorgrl lasers electron viruses bigbang condrift earthsun placebo_share_correct god bible postlife reborn reliten relig attend relactiv pray savesoul sprtprsn relpersn fund placebo_religiosity_average partyid_recode polviews_recode prayer_recode sexeduc_recode marhomo_recode abany_recode grass_recode cappun_recode gunlaw_recode letin1_recode natenvir_recode natenrgy_recode nateduc_recode natsci_recode eqwlth_recode natfare_recode natrace_recode placebo_political_average if sample_textstate==0
eststo: estpost sum  evo_approval hotcore radioact boyorgrl lasers electron viruses bigbang condrift earthsun placebo_share_correct god bible postlife reborn reliten relig attend relactiv pray savesoul sprtprsn relpersn fund placebo_religiosity_average partyid_recode polviews_recode prayer_recode sexeduc_recode marhomo_recode abany_recode grass_recode cappun_recode gunlaw_recode letin1_recode natenvir_recode natenrgy_recode nateduc_recode natsci_recode eqwlth_recode natfare_recode natrace_recode placebo_political_average if pop_textstate==1
eststo: estpost sum  evo_approval hotcore radioact boyorgrl lasers electron viruses bigbang condrift earthsun placebo_share_correct god bible postlife reborn reliten relig attend relactiv pray savesoul sprtprsn relpersn fund placebo_religiosity_average partyid_recode polviews_recode prayer_recode sexeduc_recode marhomo_recode abany_recode grass_recode cappun_recode gunlaw_recode letin1_recode natenvir_recode natenrgy_recode nateduc_recode natsci_recode eqwlth_recode natfare_recode natrace_recode placebo_political_average if pop_textstate==0

esttab using appendix_sample_representativity.tex, replace wide cells("mean(fmt(%9.2fc))") mgroups("\specialcell{Estimation Sample}" "Population", pattern(1 0 1 0) prefix(\multicolumn{@span} {c} {) suffix (}) span erepeat(\cmidrule(lr) {@span})) mlabels("Std. avail." "Std. n/a" "Std. avail." "Std. n/a") label collabels(none) booktabs nonum fragment noobs refcat(evo_approval "\emph{Main Outcome:}" hotcore "\emph{Non-Evolution Scientific Outcomes:}" god "\emph{Religious Outcomes:}" partyid_recode "\emph{Political Outcomes:}", nolabel)
eststo clear
restore

***Main Figures
cd "${path}\output\figures"

***Figure III
*Panel A

reg evo_approval_conv pre78 pre56 pre34 zero post01 post23 post45 i.surveyyear i.state16 i.cohort if less_evolution==1, vce(cluster state16)

testparm pre*
testparm post*

forvalue i=1(1)20 {
	local m_`i'=e(b)[1,`i']
	local v_`i'=e(V)[`i',`i']
}

matrix input mat1_twfe= (`m_1',`m_2',`m_3',`m_4',`m_5',`m_6',`m_7')
mat colnames mat1_twfe=   g_m3 g_m2 g_m1 g_0 g_1 g_2 g_3

matrix input mat3_twfe= (`v_1',`v_2',`v_3',`v_4',`v_5',`v_6',`v_7')
mat colnames mat3_twfe=  g_m3 g_m2 g_m1 g_0 g_1 g_2 g_3

event_plot mat1_twfe#mat3_twfe, stub_lag(g_#) stub_lead(g_m#) ciplottype(rcap) plottype(scatter) ///
		graph_opt(bgcolor(white) plotregion(color(white)) graphregion(color(white)) ///
		xline(-0, lpattern(dash) lcolor(gs12) lwidth(thin)) legend(off) ///
		yline(0, lpattern(solid) lcolor(gs12) lwidth(thin)) legend(off) ///
		yscale(r(-0.5 0.75)) ytick(-0.5(0.25)0.5) ///
		ylabel(-0.5(0.25)0.75, labsize(small)) ///
		xscale(r(-3.5 2.5)) xtick(-3(1)2) xlabel(-3 "-7" -2 "-5" -1 "-3"  0 "-1"  1 "1" 2 "3" 3 "5", labsize(small)) ///
		ytitle("Evolution Belief", height(6) size(small)) title("TWFE", size(small)) ///
		xtitle("Year to/from Evolution Curriculum Reform", height(6) size(small)) xsize(5) ysize(4)) ///
		lag_opt(msymbol(D) mcolor(black) msize(small)) lead_opt(msymbol(D) mcolor(black) msize(small)) ///
		lag_ci_opt(lcolor(black) lwidth(medthin)) lead_ci_opt(lcolor(black) lwidth(medthin))

graph save "event_study_TWFE.pdf", replace

csdid evo_approval_conv if less_evolution==1, time(highschoolentryyear) notyet gvar(first_treat) agg(event) method(dripw) rseed(2) cluster(state16)
csdid_plot
estat all

estat cevent, window(-20 -7)
local b_13 = r(table)[1,1]

estat cevent, window(-6 -5)
local b_14 = r(table)[1,1]

estat cevent, window(-4 -3)
local b_15 = r(table)[1,1]

estat cevent, window(-2 -1)
local b_16 = r(table)[1,1]

estat cevent, window(0 1)
local b_17 = r(table)[1,1]

estat cevent, window(2 3)
local b_18 = r(table)[1,1]

estat cevent, window(4 20)
local b_19 = r(table)[1,1]


matrix define mat1_cs=(`b_13',`b_14',`b_15',`b_16',`b_17',`b_18',`b_19')
mat colnames mat1_cs = T-3 T-2 T-1 T+0 T+1 T+2 T+3

estat cevent, window(-20 -7)
local v_13 = r(table)[2,1]^2

estat cevent, window(-6 -5)
local v_14 = r(table)[2,1]^2

estat cevent, window(-4 -3)
local v_15 = r(table)[2,1]^2

estat cevent, window(-2 -1)
local v_16 = r(table)[2,1]^2

estat cevent, window(0 1)
local v_17 = r(table)[2,1]^2

estat cevent, window(2 3)
local v_18 = r(table)[2,1]^2

estat cevent, window(4 20)
local v_19 = r(table)[2,1]^2

matrix define mat2_cs=(`v_13',`v_14',`v_15',`v_16',`v_17',`v_18',`v_19')
mat colnames mat2_cs = T-3 T-2 T-1 T+0 T+1 T+2 T+3

event_plot mat1_cs#mat2_cs , stub_lag(T+#) stub_lead(T-#)  ciplottype(rcap) plottype(scatter) ///
		graph_opt(bgcolor(white) plotregion(color(white)) graphregion(color(white)) ///
		xline(0, lpattern(dash) lcolor(gs12) lwidth(thin)) legend(off) ///
		yline(0, lpattern(solid) lcolor(gs12) lwidth(thin)) legend(off) ///
		yscale(r(-0.5 0.75)) ytick(-0.5(0.25)0.5) ///
		ylabel(-0.5(0.25)0.75, labsize(small)) ///
		xscale(r(-3.5 2.5)) xtick(-3(1)2) xlabel(-3 "-7" -2 "-5" -1 "-3"  0 "-1"  1 "1" 2 "3" 3 "5", labsize(small)) /// 
		ytitle("Evolution Belief", height(6) size(small)) title("Callaway and Sant'Anna (2021)", size(small)) ///
		xtitle("Year to/from Evolution Curriculum Reform", height(6) size(small)) xsize(5) ysize(4)) ///
		lag_opt(msymbol(D) mcolor(black) msize(small)) lead_opt(msymbol(D) mcolor(black) msize(small)) ///
		lag_ci_opt(lcolor(black) lwidth(medthin)) lead_ci_opt(lcolor(black) lwidth(medthin))

graph save "event_study_CS.pdf", replace	

event_plot mat1_twfe#mat3_twfe  mat1_cs#mat2_cs, stub_lag(g_# T+#) stub_lead(g_m# T-#) plottype(scatter) ciplottype(rcap) together noautolegend graph_opt(xtitle("Year to/from Evolution Curriculum Reform (two-year bins)") ytitle("Evolution Belief") xlabel(-3 "-7" -2 "-5" -1 "-3"  0 "-1"  1 "1" 2 "3" 3 "5", labsize(small))  legend(order(1 "TWFE OLS" 3 "Callaway-Sant'Anna") rows(1) region(style(none))) xline(0, lcolor(gs8%60) lpattern(dash)) ylabel(-0.2 "-.2" 0 ".0" 0.2 ".2" 0.4 ".4" 0.6 ".6", labsize(small)) yline(0, lcolor(gs8%60) lpattern(dash) ) graphregion(color(white)) bgcolor(white) ylabel(, angle(horizontal))) lag_opt1(msymbol(Oh) color(dknavy)) lag_ci_opt1(color(dknavy%100))  lag_opt2(msymbol(Dh) color(cranberry)) lag_ci_opt2(color(cranberry%100))	 perturb(-0.05(0.07)0.01) alpha(0.05)
graph export "${path}\output\figures\gss-less-twfecs.pdf", replace

***Figure III
*Panel B

reg evo_approval_conv pre78 pre56 pre34 zero post01 post23 post45 i.surveyyear i.state16 i.cohort if more_evolution==1 , vce(cluster state16)

testparm pre*
testparm post*

forvalue i=1(1)20 {
	local m_`i'=e(b)[1,`i']
	local v_`i'=e(V)[`i',`i']
}

matrix input mat1_twfe= (`m_1',`m_2',`m_3',`m_4',`m_5',`m_6',`m_7')
mat colnames mat1_twfe=   g_m3 g_m2 g_m1 g_0 g_1 g_2 g_3

matrix input mat3_twfe= (`v_1',`v_2',`v_3',`v_4',`v_5',`v_6',`v_7')
mat colnames mat3_twfe=  g_m3 g_m2 g_m1 g_0 g_1 g_2 g_3

event_plot mat1_twfe#mat3_twfe, stub_lag(g_#) stub_lead(g_m#) ciplottype(rcap) plottype(scatter) ///
		graph_opt(bgcolor(white) plotregion(color(white)) graphregion(color(white)) ///
		xline(-0, lpattern(dash) lcolor(gs12) lwidth(thin)) legend(off) ///
		yline(0, lpattern(solid) lcolor(gs12) lwidth(thin)) legend(off) ///
		yscale(r(-0.5 0.75)) ytick(-0.5(0.25)0.5) ///
		ylabel(-0.5(0.25)0.75, labsize(small)) ///
		xscale(r(-3.5 2.5)) xtick(-3(1)2) xlabel(-3 "-7" -2 "-5" -1 "-3"  0 "-1"  1 "1" 2 "3" 3 "5", labsize(small)) ///
		ytitle("Evolution Belief", height(6) size(small)) title("TWFE", size(small)) ///
		xtitle("Year to/from Evolution Curriculum Reform", height(6) size(small)) xsize(5) ysize(4)) ///
		lag_opt(msymbol(D) mcolor(black) msize(small)) lead_opt(msymbol(D) mcolor(black) msize(small)) ///
		lag_ci_opt(lcolor(black) lwidth(medthin)) lead_ci_opt(lcolor(black) lwidth(medthin))

graph save "event_study_TWFE.pdf", replace

csdid evo_approval_conv if more_evolution==1 , time(highschoolentryyear) gvar(first_treat) agg(event) method(dripw) rseed(2) cluster(state16)
csdid_plot
estat all

estat cevent, window(-20 -7)
local b_13 = r(table)[1,1]

estat cevent, window(-6 -5)
local b_14 = r(table)[1,1]

estat cevent, window(-4 -3)
local b_15 = r(table)[1,1]

estat cevent, window(-2 -1)
local b_16 = r(table)[1,1]

estat cevent, window(0 1)
local b_17 = r(table)[1,1]

estat cevent, window(2 3)
local b_18 = r(table)[1,1]

estat cevent, window(4 20)
local b_19 = r(table)[1,1]


matrix define mat1_cs=(`b_13',`b_14',`b_15',`b_16',`b_17',`b_18',`b_19')
mat colnames mat1_cs = T-3 T-2 T-1 T+0 T+1 T+2 T+3

estat cevent, window(-20 -7)
local v_13 = r(table)[2,1]^2

estat cevent, window(-6 -5)
local v_14 = r(table)[2,1]^2

estat cevent, window(-4 -3)
local v_15 = r(table)[2,1]^2

estat cevent, window(-2 -1)
local v_16 = r(table)[2,1]^2

estat cevent, window(0 1)
local v_17 = r(table)[2,1]^2

estat cevent, window(2 3)
local v_18 = r(table)[2,1]^2

estat cevent, window(4 20)
local v_19 = r(table)[2,1]^2


matrix define mat2_cs=(`v_13',`v_14',`v_15',`v_16',`v_17',`v_18',`v_19')
mat colnames mat2_cs = T-3 T-2 T-1 T+0 T+1 T+2 T+3

event_plot mat1_cs#mat2_cs , stub_lag(T+#) stub_lead(T-#)  ciplottype(rcap) plottype(scatter) ///
		graph_opt(bgcolor(white) plotregion(color(white)) graphregion(color(white)) ///
		xline(0, lpattern(dash) lcolor(gs12) lwidth(thin)) legend(off) ///
		yline(0, lpattern(solid) lcolor(gs12) lwidth(thin)) legend(off) ///
		yscale(r(-0.5 0.75)) ytick(-0.5(0.25)0.5) ///
		ylabel(-0.5(0.25)0.75, labsize(small)) ///
		xscale(r(-3.5 2.5)) xtick(-3(1)2) xlabel(-3 "-7" -2 "-5" -1 "-3"  0 "-1"  1 "1" 2 "3" 3 "5", labsize(small)) /// 
		ytitle("Evolution Belief", height(6) size(small)) title("Callaway and Sant'Anna (2021)", size(small)) ///
		xtitle("Year to/from Evolution Curriculum Reform", height(6) size(small)) xsize(5) ysize(4)) ///
		lag_opt(msymbol(D) mcolor(black) msize(small)) lead_opt(msymbol(D) mcolor(black) msize(small)) ///
		lag_ci_opt(lcolor(black) lwidth(medthin)) lead_ci_opt(lcolor(black) lwidth(medthin))

graph save "event_study_CS.pdf", replace	

event_plot mat1_twfe#mat3_twfe  mat1_cs#mat2_cs, stub_lag(g_# T+#) stub_lead(g_m# T-#) plottype(scatter) ciplottype(rcap) together noautolegend graph_opt(xtitle("Year to/from Evolution Curriculum Reform (two-year bins)") ytitle("Evolution Belief") xlabel(-3 "-7" -2 "-5" -1 "-3"  0 "-1"  1 "1" 2 "3" 3 "5", labsize(small))  legend(order(1 "TWFE OLS" 3 "Callaway-Sant'Anna") rows(1) region(style(none))) xline(0, lcolor(gs8%60) lpattern(dash)) ylabel(-0.2 "-.2" 0 ".0" 0.2 ".2" 0.4 ".4" 0.6 ".6", labsize(small)) yline(0, lcolor(gs8%60) lpattern(dash) ) graphregion(color(white)) bgcolor(white) ylabel(, angle(horizontal))) lag_opt1(msymbol(Oh) color(dknavy)) lag_ci_opt1(color(dknavy%100))  lag_opt2(msymbol(Dh) color(cranberry)) lag_ci_opt2(color(cranberry%100))	 perturb(-0.05(0.07)0.01) alpha(0.05)
graph export "${path}\output\figures\gss-more-twfecs.pdf", replace

***# Bookmark #2

***Online Appendix Figures

cd "${path}\output\figures"

***Figure A.III
*Panel A

foreach v of varlist female race_white race_black race_other hispanic rural parborn_us_ni parborn_abroad_ni pareduc_nohs_ni pareduc_hs_ni pareduc_hsmore_ni family16_both family16_parstep family16_single family16_other mainline prot_evangelical relig16dummy2 relig16dummy3 relig16dummy4 relig16dummy5 relig16dummy6 relig16dummy7 relig16dummy8 relig16dummy9 relig16dummy10 relig16dummy11 relig16dummy12 relig16dummy13 {
eststo: reg evo_score `v' i.year if sample_gss==1, cluster(state16) 
estimates store dose_`v'
}

coefplot (dose_female, keep(female)) (dose_race_white, keep(race_white)) (dose_race_black, keep(race_black)) (dose_race_other, keep(race_other)) (dose_hispanic, keep(hispanic)) (dose_rural, keep(rural)) (dose_parborn_us_ni, keep(parborn_us_ni)) (dose_pareduc_nohs_ni, keep(pareduc_nohs_ni)) (dose_pareduc_hs_ni, keep(pareduc_hs_ni)) (dose_pareduc_hsmore_ni, keep(pareduc_hsmore_ni))(dose_family16_both, keep(family16_both))(dose_family16_parstep, keep(family16_parstep))(dose_family16_singlep, keep(family16_singlep))(dose_family16_other, keep(family16_other)) (dose_mainline, keep(mainline)) (dose_prot_evangelicals, keep(prot_evangelicals))(dose_relig16dummy2, keep(relig16dummy2))(dose_relig16dummy3, keep(relig16dummy3))(dose_relig16dummy4, keep(relig16dummy4))(dose_relig16dummy5, keep(relig16dummy5)), nokey graphregion(color(white)) bgcolor(white) xline(0) xlabel(-0.3(0.1)0.3) ciopts(color(black)) mcolor(black) msymbol(o) msize(small)
graph export "${path}\output\figures\dose_gss.pdf", replace
eststo clear

***Figure A.V

preserve
cd "${path}\data\gss\"

clear
set obs 38
set seed 2
 
 foreach num of numlist 1/1000 {
  gen reformyear`num'=.
  replace reformyear`num' = 2005 in 1
  replace reformyear`num' = 2006 in 2
  replace reformyear`num' = 2005 in 3
  replace reformyear`num' = 2009 in 4
  replace reformyear`num' = 2004 in 5
  replace reformyear`num' = 2006 in 6
  replace reformyear`num' = 2006 in 7
  replace reformyear`num' = 2008 in 8
  replace reformyear`num' = 2004 in 9
  replace reformyear`num' = 2005 in 10
  replace reformyear`num' = 2004 in 11
  replace reformyear`num' = 2006 in 12
  replace reformyear`num' = 2007 in 13
  replace reformyear`num' = 2007 in 14
  replace reformyear`num' = 2005 in 15
  replace reformyear`num' = 2007 in 16
  replace reformyear`num' = 2002 in 17
  replace reformyear`num' = 2006 in 18
  replace reformyear`num' = 2000 in 19
  replace reformyear`num' = 2009 in 20
  replace reformyear`num' = 2008 in 21
  replace reformyear`num' = 2008 in 22
  replace reformyear`num' = 2006 in 23
  replace reformyear`num' = 2004 in 24
  replace reformyear`num' = 2006 in 25
  replace reformyear`num' = 2003 in 26
  replace reformyear`num' = 2004 in 27
  replace reformyear`num' = 2006 in 28
  replace reformyear`num' = 2006 in 29  
  replace reformyear`num' = 2002 in 30
  replace reformyear`num' = 2006 in 31
  replace reformyear`num' = 2005 in 32
  replace reformyear`num' = 2005 in 33
  replace reformyear`num' = 2007 in 34
  replace reformyear`num' = 2009 in 35
  replace reformyear`num' = 2003 in 36
  replace reformyear`num' = 2008 in 37
  replace reformyear`num' = 2003 in 38
 
  
   gen rand`num' = runiform()
  sort rand`num'
  drop rand`num'
 
 }
 


  gen state16=.
 replace state16= 1 in 1
 replace state16= 2 in 2
 replace state16= 5 in 3
 replace state16= 8 in 4
 replace state16= 9 in 5
 replace state16= 10 in 6
 replace state16= 11 in 7
 replace state16= 12 in 8
 replace state16= 13 in 9
 replace state16= 15 in 10 
 replace state16= 17 in 11
 replace state16= 18 in 12
 replace state16= 19 in 13
 replace state16= 20 in 14
 replace state16= 22 in 15
 replace state16= 23 in 16
 replace state16= 24 in 17
 replace state16= 25 in 18
 replace state16= 26 in 19
 replace state16= 27 in 20
 replace state16= 28 in 21
 replace state16= 29 in 22
 replace state16= 30 in 23
 replace state16= 32 in 24
 replace state16= 33 in 25
 replace state16= 35 in 26
 replace state16= 37 in 27
 replace state16= 38 in 28
 replace state16= 39 in 29
 replace state16= 42 in 30
 replace state16= 44 in 31 
 replace state16= 45 in 32
 replace state16= 46 in 33
 replace state16= 47 in 34
 replace state16= 48 in 35
 replace state16= 51 in 36
 replace state16= 54 in 37
 replace state16= 56 in 38
 

order state16
save "permutation.dta", replace 
restore

merge m:1 state16 using "permutation.dta" 

tempname myresults 
postfile `myresults' threshold intercept gradient se using myresults.dta, replace 
 foreach i of num 1/1000 {
 
gen evolution_score_perm_`i'=.
replace evolution_score_perm_`i'=9 if state16==1 & highschoolentryyear<reformyear`i'
replace evolution_score_perm_`i'=21 if state16==1 & highschoolentryyear>=reformyear`i'
replace evolution_score_perm_`i'=48 if state16==2 & highschoolentryyear<reformyear`i'
replace evolution_score_perm_`i'=59 if state16==2 & highschoolentryyear>=reformyear`i'
replace evolution_score_perm_`i'=82 if state16==4 
replace evolution_score_perm_`i'=55 if state16==5 & highschoolentryyear<reformyear`i'
replace evolution_score_perm_`i'=66 if state16==5 & highschoolentryyear>=reformyear`i'
replace evolution_score_perm_`i'=100 if state16==6
replace evolution_score_perm_`i'=86 if state16==8 & highschoolentryyear<reformyear`i'
replace evolution_score_perm_`i'=82 if state16==8 & highschoolentryyear>=reformyear`i'
replace evolution_score_perm_`i'=100 if state16==9 & highschoolentryyear<reformyear`i'
replace evolution_score_perm_`i'=59 if state16==9 & highschoolentryyear>=reformyear`i'
replace evolution_score_perm_`i'=91 if state16==10 & highschoolentryyear<reformyear`i'
replace evolution_score_perm_`i'=80 if state16==10 & highschoolentryyear>=reformyear`i'
replace evolution_score_perm_`i'=80 if state16==11 & highschoolentryyear<reformyear`i'
replace evolution_score_perm_`i'=96 if state16==11 & highschoolentryyear>=reformyear`i'
replace evolution_score_perm_`i'=16 if state16==12 & highschoolentryyear<reformyear`i'
replace evolution_score_perm_`i'=91 if state16==12 & highschoolentryyear>=reformyear`i'
replace evolution_score_perm_`i'=7 if state16==13 & highschoolentryyear<reformyear`i'
replace evolution_score_perm_`i'=66 if state16==13 & highschoolentryyear>=reformyear`i'
replace evolution_score_perm_`i'=91 if state16==15 & highschoolentryyear<reformyear`i'
replace evolution_score_perm_`i'=75 if state16==15 & highschoolentryyear>=reformyear`i'
replace evolution_score_perm_`i'=82 if state16==16 
replace evolution_score_perm_`i'=45 if state16==17 & highschoolentryyear<reformyear`i'
replace evolution_score_perm_`i'=82 if state16==17 & highschoolentryyear>=reformyear`i'
replace evolution_score_perm_`i'=100 if state16==18 & highschoolentryyear<reformyear`i'
replace evolution_score_perm_`i'=96 if state16==18 & highschoolentryyear>=reformyear`i'
replace evolution_score_perm_`i'=77 if state16==19 & highschoolentryyear>=reformyear`i'
replace evolution_score_perm_`i'=0 if state16==20 & highschoolentryyear<reformyear`i'
replace evolution_score_perm_`i'=96 if state16==20 & highschoolentryyear>=reformyear`i'
replace evolution_score_perm_`i'=55 if state16==21 
replace evolution_score_perm_`i'=64 if state16==22 & highschoolentryyear<reformyear`i'
replace evolution_score_perm_`i'=27 if state16==22 & highschoolentryyear>=reformyear`i'
replace evolution_score_perm_`i'=30 if state16==23 & highschoolentryyear<reformyear`i'
replace evolution_score_perm_`i'=68 if state16==23 & highschoolentryyear>=reformyear`i'
replace evolution_score_perm_`i'=77 if state16==24 & highschoolentryyear<reformyear`i'
replace evolution_score_perm_`i'=73 if state16==24 & highschoolentryyear>=reformyear`i'
replace evolution_score_perm_`i'=82 if state16==25 & highschoolentryyear<reformyear`i'
replace evolution_score_perm_`i'=84 if state16==25 & highschoolentryyear>=reformyear`i'
replace evolution_score_perm_`i'=84 if state16==26 & highschoolentryyear<reformyear`i'
replace evolution_score_perm_`i'=80 if state16==26 & highschoolentryyear>=reformyear`i'
replace evolution_score_perm_`i'=86 if state16==27 & highschoolentryyear<reformyear`i'
replace evolution_score_perm_`i'=89 if state16==27 & highschoolentryyear>=reformyear`i'
replace evolution_score_perm_`i'=5 if state16==28 & highschoolentryyear<reformyear`i'
replace evolution_score_perm_`i'=87 if state16==28 & highschoolentryyear>=reformyear`i'
replace evolution_score_perm_`i'=82 if state16==29 & highschoolentryyear<reformyear`i'
replace evolution_score_perm_`i'=78 if state16==29 & highschoolentryyear>=reformyear`i'
replace evolution_score_perm_`i'=82 if state16==30 & highschoolentryyear<reformyear`i'
replace evolution_score_perm_`i'=75 if state16==30 & highschoolentryyear>=reformyear`i'
replace evolution_score_perm_`i'=66 if state16==31
replace evolution_score_perm_`i'=70 if state16==32 & highschoolentryyear<reformyear`i'
replace evolution_score_perm_`i'=77 if state16==32 & highschoolentryyear>=reformyear`i'
replace evolution_score_perm_`i'=23 if state16==33 & highschoolentryyear<reformyear`i'
replace evolution_score_perm_`i'=91 if state16==33 & highschoolentryyear>=reformyear`i'
replace evolution_score_perm_`i'=100 if state16==34 
replace evolution_score_perm_`i'=73 if state16==35 & highschoolentryyear<reformyear`i'
replace evolution_score_perm_`i'=91 if state16==35 & highschoolentryyear>=reformyear`i'
replace evolution_score_perm_`i'=68 if state16==36
replace evolution_score_perm_`i'=100 if state16==37 & highschoolentryyear<reformyear`i'
replace evolution_score_perm_`i'=82 if state16==37 & highschoolentryyear>=reformyear`i'
replace evolution_score_perm_`i'=9 if state16==38 & highschoolentryyear<reformyear`i'
replace evolution_score_perm_`i'=64 if state16==38 & highschoolentryyear>=reformyear`i'
replace evolution_score_perm_`i'=30 if state16==39 & highschoolentryyear<reformyear`i'
replace evolution_score_perm_`i'=86 if state16==39 & highschoolentryyear>=reformyear`i'
replace evolution_score_perm_`i'=25 if state16==40 
replace evolution_score_perm_`i'=82 if state16==41 
replace evolution_score_perm_`i'=91 if state16==42 & highschoolentryyear<reformyear`i'
replace evolution_score_perm_`i'=96 if state16==42 & highschoolentryyear>=reformyear`i'
replace evolution_score_perm_`i'=100 if state16==44 & highschoolentryyear<reformyear`i'
replace evolution_score_perm_`i'=82 if state16==44 & highschoolentryyear>=reformyear`i'
replace evolution_score_perm_`i'=95 if state16==45 & highschoolentryyear<reformyear`i'
replace evolution_score_perm_`i'=91 if state16==45 & highschoolentryyear>=reformyear`i'
replace evolution_score_perm_`i'=82 if state16==46 & highschoolentryyear<reformyear`i'
replace evolution_score_perm_`i'=77 if state16==46 & highschoolentryyear>=reformyear`i'
replace evolution_score_perm_`i'=2 if state16==47 & highschoolentryyear<reformyear`i'
replace evolution_score_perm_`i'=55 if state16==47 & highschoolentryyear>=reformyear`i'
replace evolution_score_perm_`i'=64 if state16==48 & highschoolentryyear<reformyear`i'
replace evolution_score_perm_`i'=46 if state16==48 & highschoolentryyear>=reformyear`i'
replace evolution_score_perm_`i'=82 if state16==49 
replace evolution_score_perm_`i'=86 if state16==50 
replace evolution_score_perm_`i'=50 if state16==51 & highschoolentryyear<reformyear`i'
replace evolution_score_perm_`i'=68 if state16==51 & highschoolentryyear>=reformyear`i'
replace evolution_score_perm_`i'=86 if state16==53 
replace evolution_score_perm_`i'=2 if state16==54 & highschoolentryyear<reformyear`i'
replace evolution_score_perm_`i'=46 if state16==54 & highschoolentryyear>=reformyear`i'
replace evolution_score_perm_`i'=55 if state16==55
replace evolution_score_perm_`i'=36 if state16==56 & highschoolentryyear<reformyear`i'
replace evolution_score_perm_`i'=61 if state16==56 & highschoolentryyear>=reformyear`i'
gen evo_score_perm_`i' = evolution_score_perm_`i'/100
label variable evo_score_perm_`i' "Evolution Score"

reg evo_approval evo_score_perm_`i' $controls i.state16 i.cohort, cluster(state16) baselevels
post `myresults' (`i') (`=_b[_cons]') (`=_b[evo_score_perm_`i']') (`=_se[evo_score_perm_`i']') 
}
postclose `myresults' 

preserve
use "${path}\data\gss\myresults.dta", clear
twoway kdensity gradient, lcolor(black) xline(0.333, lcolor(red)) xline(0.315, lcolor(black) lpattern(dash)) graphregion(fcolor(white)) bgcolor(white) plotregion(fcolor(white)) xtitle("Coefficients from placebo regressions") ytitle("Density")
graph export "${path}\output\figures\permutations_gss.pdf", replace
sum gradient, d
restore

***Figure A.VIII
*Panel A

reghdfe evo_approval_conv pre78 pre56 pre34 zero post01 post23 post45 if less_evolution==1, absorb(surveyyear state16 cohort) cluster(state16) noconstant
matrix l_vec = 1 \ 0 \ 0
local plotopts xtitle(Mbar) ytitle(95% Robust CI)
honestdid, l_vec(l_vec) pre(1/3) post(4/6) mvec(0(0.01)0.15)  omit alpha(0.05) delta(sd) coefplot `plotopts' yscale(r(0 0.8)) ytick(0(0.2)0.8) ylabel(0(0.2)0.8)
graph export "${path}\output\figures\gss-less-rr.pdf", replace

***Figure A.VIII
*Panel B

reghdfe evo_approval_conv pre78 pre56 pre34 zero post01 post23 post45 if more_evolution==1, absorb(surveyyear state16 cohort) cluster(state16) noconstant
matrix l_vec = 1 \ 0 \ 0
local plotopts xtitle(Mbar) ytitle(95% Robust CI)
honestdid, l_vec(l_vec) pre(1/3) post(4/6) mvec(0(0.01)0.15) omit alpha(0.05) delta(sd) coefplot `plotopts' ytick(-0.4(0.2)0.6) ylabel(-0.4(0.2)0.6)
graph export "${path}\output\figures\gss-more-rr.pdf", replace

***Figure A.XI
*Panel A

reg evo_approval_conv pre78 pre56 pre34 zero post01 post23 post45  i.surveyyear i.state16 i.cohort if less_evolution==1 | state16==31 | state16==41 | state16==49 | state16==55, vce(cluster state16)

testparm pre*
testparm post*

forvalue i=1(1)20 {
	local m_`i'=e(b)[1,`i']
	local v_`i'=e(V)[`i',`i']
}

matrix input mat1_twfe= (`m_1',`m_2',`m_3',`m_4',`m_5',`m_6',`m_7')
mat colnames mat1_twfe=   g_m3 g_m2 g_m1 g_0 g_1 g_2 g_3

matrix input mat3_twfe= (`v_1',`v_2',`v_3',`v_4',`v_5',`v_6',`v_7')
mat colnames mat3_twfe=  g_m3 g_m2 g_m1 g_0 g_1 g_2 g_3

event_plot mat1_twfe#mat3_twfe, stub_lag(g_#) stub_lead(g_m#) ciplottype(rcap) plottype(scatter) ///
		graph_opt(bgcolor(white) plotregion(color(white)) graphregion(color(white)) ///
		xline(-0, lpattern(dash) lcolor(gs12) lwidth(thin)) legend(off) ///
		yline(0, lpattern(solid) lcolor(gs12) lwidth(thin)) legend(off) ///
		yscale(r(-0.5 0.75)) ytick(-0.5(0.25)0.5) ///
		ylabel(-0.5(0.25)0.75, labsize(small)) ///
		xscale(r(-3.5 2.5)) xtick(-3(1)2) xlabel(-3 "-7" -2 "-5" -1 "-3"  0 "-1"  1 "1" 2 "3" 3 "5", labsize(small)) ///
		ytitle("Evolution Belief", height(6) size(small)) title("TWFE", size(small)) ///
		xtitle("Year to/from Evolution Curriculum Reform", height(6) size(small)) xsize(5) ysize(4)) ///
		lag_opt(msymbol(D) mcolor(black) msize(small)) lead_opt(msymbol(D) mcolor(black) msize(small)) ///
		lag_ci_opt(lcolor(black) lwidth(medthin)) lead_ci_opt(lcolor(black) lwidth(medthin))

graph save "event_study_TWFE.pdf", replace

csdid evo_approval_conv if less_evolution==1 | state16==31 | state16==41 | state16==49 | state16==55 , time(highschoolentryyear) notyet gvar(first_treat) agg(event) method(dripw) rseed(2) cluster(state16)
csdid_plot
estat all

estat cevent, window(-20 -7)
local b_13 = r(table)[1,1]

estat cevent, window(-6 -5)
local b_14 = r(table)[1,1]

estat cevent, window(-4 -3)
local b_15 = r(table)[1,1]

estat cevent, window(-2 -1)
local b_16 = r(table)[1,1]

estat cevent, window(0 1)
local b_17 = r(table)[1,1]

estat cevent, window(2 3)
local b_18 = r(table)[1,1]

estat cevent, window(4 20)
local b_19 = r(table)[1,1]

matrix define mat1_cs=(`b_13',`b_14',`b_15',`b_16',`b_17',`b_18',`b_19')
mat colnames mat1_cs = T-3 T-2 T-1 T+0 T+1 T+2 T+3

estat cevent, window(-20 -7)
local v_13 = r(table)[2,1]^2

estat cevent, window(-6 -5)
local v_14 = r(table)[2,1]^2

estat cevent, window(-4 -3)
local v_15 = r(table)[2,1]^2

estat cevent, window(-2 -1)
local v_16 = r(table)[2,1]^2

estat cevent, window(0 1)
local v_17 = r(table)[2,1]^2

estat cevent, window(2 3)
local v_18 = r(table)[2,1]^2

estat cevent, window(4 20)
local v_19 = r(table)[2,1]^2

matrix define mat2_cs=(`v_13',`v_14',`v_15',`v_16',`v_17',`v_18',`v_19')
mat colnames mat2_cs = T-3 T-2 T-1 T+0 T+1 T+2 T+3

event_plot mat1_cs#mat2_cs , stub_lag(T+#) stub_lead(T-#)  ciplottype(rcap) plottype(scatter) ///
		graph_opt(bgcolor(white) plotregion(color(white)) graphregion(color(white)) ///
		xline(0, lpattern(dash) lcolor(gs12) lwidth(thin)) legend(off) ///
		yline(0, lpattern(solid) lcolor(gs12) lwidth(thin)) legend(off) ///
		yscale(r(-0.5 0.75)) ytick(-0.5(0.25)0.5) ///
		ylabel(-0.5(0.25)0.75, labsize(small)) ///
		xscale(r(-3.5 2.5)) xtick(-3(1)2) xlabel(-3 "-7" -2 "-5" -1 "-3"  0 "-1"  1 "1" 2 "3" 3 "5", labsize(small)) /// 
		ytitle("Evolution Belief", height(6) size(small)) title("Callaway and Sant'Anna (2021)", size(small)) ///
		xtitle("Year to/from Evolution Curriculum Reform", height(6) size(small)) xsize(5) ysize(4)) ///
		lag_opt(msymbol(D) mcolor(black) msize(small)) lead_opt(msymbol(D) mcolor(black) msize(small)) ///
		lag_ci_opt(lcolor(black) lwidth(medthin)) lead_ci_opt(lcolor(black) lwidth(medthin))

graph save "event_study_CS.pdf", replace	

event_plot mat1_twfe#mat3_twfe  mat1_cs#mat2_cs, stub_lag(g_# T+#) stub_lead(g_m# T-#) plottype(scatter) ciplottype(rcap) together noautolegend graph_opt(xtitle("Year to/from Evolution Curriculum Reform (two-year bins)") ytitle("Evolution Belief") xlabel(-3 "-7" -2 "-5" -1 "-3"  0 "-1"  1 "1" 2 "3" 3 "5", labsize(small))  legend(order(1 "TWFE OLS" 3 "Callaway-Sant'Anna") rows(1) region(style(none))) xline(0, lcolor(gs8%60) lpattern(dash)) ylabel(-0.2 "-.2" 0 ".0" 0.2 ".2" 0.4 ".4" 0.6 ".6", labsize(small)) yline(0, lcolor(gs8%60) lpattern(dash) ) graphregion(color(white)) bgcolor(white) ylabel(, angle(horizontal))) lag_opt1(msymbol(Oh) color(dknavy)) lag_ci_opt1(color(dknavy%100))  lag_opt2(msymbol(Dh) color(cranberry)) lag_ci_opt2(color(cranberry%100))	 perturb(-0.05(0.07)0.01) alpha(0.05)
graph export "${path}\output\figures\gss-less_twfecs_nevert.pdf", replace

***Figure A.XI
*Panel B

reg evo_approval_conv pre78 pre56 pre34 zero post01 post23 post45  i.surveyyear i.state16 i.cohort if more_evolution==1 | state16==31 | state16==41 | state16==49 | state16==55, vce(cluster state16)

testparm pre*
testparm post*

forvalue i=1(1)20 {
	local m_`i'=e(b)[1,`i']
	local v_`i'=e(V)[`i',`i']
}

matrix input mat1_twfe= (`m_1',`m_2',`m_3',`m_4',`m_5',`m_6',`m_7')
mat colnames mat1_twfe=   g_m3 g_m2 g_m1 g_0 g_1 g_2 g_3

matrix input mat3_twfe= (`v_1',`v_2',`v_3',`v_4',`v_5',`v_6',`v_7')
mat colnames mat3_twfe=  g_m3 g_m2 g_m1 g_0 g_1 g_2 g_3

event_plot mat1_twfe#mat3_twfe, stub_lag(g_#) stub_lead(g_m#) ciplottype(rcap) plottype(scatter) ///
		graph_opt(bgcolor(white) plotregion(color(white)) graphregion(color(white)) ///
		xline(-0, lpattern(dash) lcolor(gs12) lwidth(thin)) legend(off) ///
		yline(0, lpattern(solid) lcolor(gs12) lwidth(thin)) legend(off) ///
		yscale(r(-0.5 0.75)) ytick(-0.5(0.25)0.5) ///
		ylabel(-0.5(0.25)0.75, labsize(small)) ///
		xscale(r(-3.5 2.5)) xtick(-3(1)2) xlabel(-3 "-7" -2 "-5" -1 "-3"  0 "-1"  1 "1" 2 "3" 3 "5", labsize(small)) ///
		ytitle("Evolution Belief", height(6) size(small)) title("TWFE", size(small)) ///
		xtitle("Year to/from Evolution Curriculum Reform", height(6) size(small)) xsize(5) ysize(4)) ///
		lag_opt(msymbol(D) mcolor(black) msize(small)) lead_opt(msymbol(D) mcolor(black) msize(small)) ///
		lag_ci_opt(lcolor(black) lwidth(medthin)) lead_ci_opt(lcolor(black) lwidth(medthin))

graph save "event_study_TWFE.pdf", replace

csdid evo_approval_conv if more_evolution==1 | state16==31 | state16==41 | state16==49 | state16==55 , time(highschoolentryyear) notyet gvar(first_treat) agg(event) method(dripw) rseed(2) cluster(state16)
csdid_plot
estat all

estat cevent, window(-20 -7)
local b_13 = r(table)[1,1]

estat cevent, window(-6 -5)
local b_14 = r(table)[1,1]

estat cevent, window(-4 -3)
local b_15 = r(table)[1,1]

estat cevent, window(-2 -1)
local b_16 = r(table)[1,1]

estat cevent, window(0 1)
local b_17 = r(table)[1,1]

estat cevent, window(2 3)
local b_18 = r(table)[1,1]

estat cevent, window(4 20)
local b_19 = r(table)[1,1]

matrix define mat1_cs=(`b_13',`b_14',`b_15',`b_16',`b_17',`b_18',`b_19')
mat colnames mat1_cs = T-3 T-2 T-1 T+0 T+1 T+2 T+3

estat cevent, window(-20 -7)
local v_13 = r(table)[2,1]^2

estat cevent, window(-6 -5)
local v_14 = r(table)[2,1]^2

estat cevent, window(-4 -3)
local v_15 = r(table)[2,1]^2

estat cevent, window(-2 -1)
local v_16 = r(table)[2,1]^2

estat cevent, window(0 1)
local v_17 = r(table)[2,1]^2

estat cevent, window(2 3)
local v_18 = r(table)[2,1]^2

estat cevent, window(4 20)
local v_19 = r(table)[2,1]^2

matrix define mat2_cs=(`v_13',`v_14',`v_15',`v_16',`v_17',`v_18',`v_19')
mat colnames mat2_cs = T-3 T-2 T-1 T+0 T+1 T+2 T+3

event_plot mat1_cs#mat2_cs , stub_lag(T+#) stub_lead(T-#)  ciplottype(rcap) plottype(scatter) ///
		graph_opt(bgcolor(white) plotregion(color(white)) graphregion(color(white)) ///
		xline(0, lpattern(dash) lcolor(gs12) lwidth(thin)) legend(off) ///
		yline(0, lpattern(solid) lcolor(gs12) lwidth(thin)) legend(off) ///
		yscale(r(-0.5 0.75)) ytick(-0.5(0.25)0.5) ///
		ylabel(-0.5(0.25)0.75, labsize(small)) ///
		xscale(r(-3.5 2.5)) xtick(-3(1)2) xlabel(-3 "-7" -2 "-5" -1 "-3"  0 "-1"  1 "1" 2 "3" 3 "5", labsize(small)) /// 
		ytitle("Evolution Belief", height(6) size(small)) title("Callaway and Sant'Anna (2021)", size(small)) ///
		xtitle("Year to/from Evolution Curriculum Reform", height(6) size(small)) xsize(5) ysize(4)) ///
		lag_opt(msymbol(D) mcolor(black) msize(small)) lead_opt(msymbol(D) mcolor(black) msize(small)) ///
		lag_ci_opt(lcolor(black) lwidth(medthin)) lead_ci_opt(lcolor(black) lwidth(medthin))

graph save "event_study_CS.pdf", replace	

event_plot mat1_twfe#mat3_twfe  mat1_cs#mat2_cs, stub_lag(g_# T+#) stub_lead(g_m# T-#) plottype(scatter) ciplottype(rcap) together noautolegend graph_opt(xtitle("Year to/from Evolution Curriculum Reform (two-year bins)") ytitle("Evolution Belief") xlabel(-3 "-7" -2 "-5" -1 "-3"  0 "-1"  1 "1" 2 "3" 3 "5", labsize(small))  legend(order(1 "TWFE OLS" 3 "Callaway-Sant'Anna") rows(1) region(style(none))) xline(0, lcolor(gs8%60) lpattern(dash)) ylabel(-0.2 "-.2" 0 ".0" 0.2 ".2" 0.4 ".4" 0.6 ".6", labsize(small)) yline(0, lcolor(gs8%60) lpattern(dash) ) graphregion(color(white)) bgcolor(white) ylabel(, angle(horizontal))) lag_opt1(msymbol(Oh) color(dknavy)) lag_ci_opt1(color(dknavy%100))  lag_opt2(msymbol(Dh) color(cranberry)) lag_ci_opt2(color(cranberry%100))	 perturb(-0.05(0.07)0.01) alpha(0.05)
graph export "${path}\output\figures\gss-more_twfecs_nevert.pdf", replace

***Figure A.XV

reg evo_approval evo_score $controls i.state16 i.cohort, vce(cluster state16)
estimates store Overall
reg evo_approval evo_score $controls i.state16 i.cohort if female==1, vce(cluster state16)
estimates store Female
reg evo_approval evo_score $controls i.state16 i.cohort if female==0, vce(cluster state16)
estimates store Male
reg evo_approval evo_score $controls i.state16 i.cohort if race_white==1, vce(cluster state16)
estimates store White
reg evo_approval evo_score $controls i.state16 i.cohort if race_black==1, vce(cluster state16)
estimates store Black
reg evo_approval evo_score $controls i.state16 i.cohort if hispanic==1, vce(cluster state16)
estimates store Hispanic
reg evo_approval evo_score $controls i.state16 i.cohort if parborn_abroad==1, vce(cluster state16)
estimates store Abroad
reg evo_approval evo_score $controls i.state16 i.cohort if parborn_abroad==0, vce(cluster state16)
estimates store US
reg evo_approval evo_score $controls i.state16 i.cohort if family16_both==1, vce(cluster state16)
estimates store Yes
reg evo_approval evo_score $controls i.state16 i.cohort if family16_both==0, vce(cluster state16)
estimates store No
reg evo_approval evo_score $controls i.state16 i.cohort if rural==0, vce(cluster state16)
estimates store Urban
reg evo_approval evo_score $controls i.state16 i.cohort if rural==1, vce(cluster state16)
estimates store Rural
reg evo_approval evo_score $controls i.state16 i.cohort if mainline==1, vce(cluster state16)
estimates store Mainline_Protestant
reg evo_approval evo_score $controls i.state16 i.cohort if prot_evangelicals==1, vce(cluster state16)
estimates store Evangelical_Protestant
reg evo_approval evo_score $controls i.state16 i.cohort if relig16dummy2==1, vce(cluster state16)
estimates store Catholic
reg evo_approval evo_score $controls i.state16 i.cohort if relig16dummy4==1, vce(cluster state16)
estimates store Non_Religious

coefplot Overall || Female || Male || White || Black || Hispanic || Abroad || US || Yes || No || Urban || Rural || Mainline_Protestant || Evangelical_Protestant || Catholic || Non_Religious, keep(evo_score) xline(0, lcolor(maroon)) ciopts(lcolor(navy)) mcolor(navy) asequation bycoefs byopts(xrescale) graphregion(color(white)) bgcolor(white) levels(95)  bylabels("Overall (n=1,801)" "Female (n=1,028)" "Male (n=773)" "White (n=1,255)" "Black (n=330)" "Hispanic (n=290)" "Abroad (n=340)" "US (n=1,461)" "Yes (n=984)" "No (n=817)" "Urban (n=913)" "Rural (n=888)" "Mainline Protestant (n=677)" "Evangelical Protestant (n=171)" "Catholic (n=579)" "Non-Religious (n=244)") headings (2= "{bf: By Gender}" 4= "{bf: By Race/Ethnicity}" 7="{bf: By Parental/Birth Place}" 9="{bf: By Raised by Both Parents}" 11="{bf: By Area Raised in}" 13="{bf: By Religion Raised in}")
graph export "${path}\output\figures\gss_coefplot_heterogeneities.pdf", replace



